{extend name="public/iframe" /}

{block name="top"}
{:load_assets('upload,select2,form','css')}
{/block}

{block name="content"}
<div class="card card-body {eq name='layout' value='dialog'}shadow-none{/eq}">									
    <form action="" method="post" id="validate-form">
        <input type="hidden" name="id" value="{$info.id}">
        <div class="row mb-sm-3">
            <label  class="col-xxl-1 col-lg-2 col-sm-3 col-12 col-form-label required">用户组</label>
            <div class="col-xl-4 col-sm-5 col-12 form-item">
                <select class="form-select" name="group_ids[]" multiple  data-control="select2" data-language="zh-CN" data-allow-clear="true" data-placeholder="请选择" data-rule="用户组:required">
                    {foreach name="groups" item="group"}
                    <option value="{$group.id}" {in name="group.id" value="$group_ids"}selected{/in}>{$group.prefix}{$group.title}</option>
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="row mb-sm-3">
            <label  class="col-xxl-1 col-lg-2 col-sm-3 col-12 col-form-label required">用户名</label>
            <div class="col-lg-10 col-sm-9 col-12 form-item">
                <input type="text" class="form-control" name="username" value="{$info.username}" data-rule="用户名:required;username">
            </div>
        </div>
        <div class="row mb-sm-3">
            <label  class="col-xxl-1 col-lg-2 col-sm-3 col-12 col-form-label">登录密码</label>
            <div class="col-lg-10 col-sm-9 col-12 form-item">
                <input type="password" class="form-control" name="password" value="" data-rule="登录密码:password">
                <div class="form-text text-muted">填写表示要修改密码，不修改则留空</div>
            </div>
        </div>
        <div class="row mb-sm-3">
            <label  class="col-xxl-1 col-lg-2 col-sm-3 col-12 col-form-label">姓名</label>
            <div class="col-lg-10 col-sm-9 col-12 form-item">
                <input type="text" class="form-control" name="name" value="{$info.name}" data-rule="姓名:name">
            </div>
        </div>
        <div class="row mb-sm-3">
            <label  class="col-xxl-1 col-lg-2 col-sm-3 col-12 col-form-label">头像</label>
            <div class="col-lg-10 col-sm-9 col-12 form-item">
                {:build_upload_template('avatar',$info.avatar)}
            </div>
        </div>
        <div class="row mb-sm-3">
            <label  class="col-xxl-1 col-lg-2 col-sm-3 col-12 col-form-label">手机号</label>
            <div class="col-lg-10 col-sm-9 col-12 form-item">
                <input type="text" class="form-control" name="mobile" value="{$info.mobile}" data-rule="手机号:mobile">
            </div>
        </div>
        <div class="row mb-sm-3">
            <label  class="col-xxl-1 col-lg-2 col-sm-3 col-12 col-form-label">邮箱</label>
            <div class="col-lg-10 col-sm-9 col-12 form-item">
                <input type="text" class="form-control" name="email" value="{$info.email}" data-rule="邮箱:email;length(~50)">
            </div>
        </div>
        <div class="row mb-sm-3">
            <label  class="col-xxl-1 col-lg-2 col-sm-3 col-12 col-form-label required">状态</label>
            <div class="col-lg-10 col-sm-9 col-12 mt-sm-2 form-item">
                <div class="form-check form-check-custom  form-check-inline">
                    <label class="form-check-label">
                        <input class="form-check-input w-20px h-20px" type="radio" name="status"  value="1" {eq name="info.status" value="1"}checked{/eq} data-rule="状态:checked"> 启用
                    </label>
                </div>
                <div class="form-check  form-check-custom form-check-inline">
                    <label class="form-check-label">
                        <input class="form-check-input w-20px h-20px" type="radio" name="status"  value="0" {eq name="info.status" value="0"}checked{/eq}> 禁用
                    </label>
                </div>
                <div class="form-text text-muted">禁用后则不能正常登录</div>
            </div>
        </div>
        {include file="public/formfooter" /}
    </form>
</div>
{/block}

{block name="bottom"}
{:load_assets('upload,select2,form','js')}
{/block}